/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PICView.java
 *
 * Created on 29.04.2010, 16:08:14
 */
package gui;

import extern.Clock;
import java.io.File;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFileChooser;
import gui.control.Pic;
import gui.control.StartThread;
import java.awt.Image;
import java.awt.Toolkit;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

/**
 * User Interface für Pic-Simulator. Dient zur Kommunikation mit dem Nutzer.
 * Wurde mit Netbeans Matisse erstellt.
 * @author Patrick Lehmann
 */
public class PICView extends javax.swing.JFrame {

    private StartThread thread = null;
    private Clock clock = null;
    private boolean toggle = true;

    /** Creates new form PICView */
    public PICView() {
        // Install a different look and feel; specifically, the Windows look and feel
        try {
            UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
        } catch (InstantiationException e) {
        } catch (ClassNotFoundException e) {
        } catch (UnsupportedLookAndFeelException e) {
        } catch (IllegalAccessException e) {
        }
        //Icon setzen
        Image im = Toolkit.getDefaultToolkit().getImage("icon\\JustIcon32.jpg");
        setIconImage(im);

        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jFileChooser1 = new javax.swing.JFileChooser();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        sourceCodeTable = new javax.swing.JTable();
        jPanel2 = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        txtHardware = new javax.swing.JLabel();
        jComboBox1 = new javax.swing.JComboBox();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        RegTableBank0 = new javax.swing.JTable();
        jScrollPane3 = new javax.swing.JScrollPane();
        RegTableBank1 = new javax.swing.JTable();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jScrollPane4 = new javax.swing.JScrollPane();
        stackTable = new javax.swing.JTable();
        txtPC = new javax.swing.JTextField();
        txtW = new javax.swing.JTextField();
        txtStatus = new javax.swing.JTextField();
        txtFSR = new javax.swing.JTextField();
        txtOpt = new javax.swing.JTextField();
        txtTime = new javax.swing.JTextField();
        jLabelPrescaler = new javax.swing.JLabel();
        jLabelcurrentPrescalerRatio = new javax.swing.JLabel();
        txtPrescaler = new javax.swing.JTextField();
        txtRatio = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        boxA0 = new javax.swing.JCheckBox();
        boxA1 = new javax.swing.JCheckBox();
        boxA2 = new javax.swing.JCheckBox();
        boxA3 = new javax.swing.JCheckBox();
        boxA4 = new javax.swing.JCheckBox();
        boxB3 = new javax.swing.JCheckBox();
        boxB4 = new javax.swing.JCheckBox();
        boxB1 = new javax.swing.JCheckBox();
        boxB2 = new javax.swing.JCheckBox();
        boxB0 = new javax.swing.JCheckBox();
        boxB6 = new javax.swing.JCheckBox();
        boxB7 = new javax.swing.JCheckBox();
        boxB5 = new javax.swing.JCheckBox();
        jLabel9 = new javax.swing.JLabel();
        boxLatchA0 = new javax.swing.JCheckBox();
        boxLatchA1 = new javax.swing.JCheckBox();
        boxLatchA2 = new javax.swing.JCheckBox();
        boxLatchA3 = new javax.swing.JCheckBox();
        boxLatchA4 = new javax.swing.JCheckBox();
        boxLatchB5 = new javax.swing.JCheckBox();
        boxLatchB1 = new javax.swing.JCheckBox();
        boxLatchB3 = new javax.swing.JCheckBox();
        boxLatchB4 = new javax.swing.JCheckBox();
        boxLatchB7 = new javax.swing.JCheckBox();
        boxLatchB6 = new javax.swing.JCheckBox();
        boxLatchB0 = new javax.swing.JCheckBox();
        boxLatchB2 = new javax.swing.JCheckBox();
        jLabel10 = new javax.swing.JLabel();
        buttTaktEin = new javax.swing.JButton();
        jLabel12 = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem3 = new javax.swing.JMenuItem();

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance().getContext().getResourceMap(PICView.class);
        jFileChooser1.setBackground(resourceMap.getColor("jFileChooser1.background")); // NOI18N
        jFileChooser1.setCurrentDirectory(new java.io.File("C:\\"));
            jFileChooser1.setDialogTitle(resourceMap.getString("jFileChooser1.dialogTitle")); // NOI18N
            jFileChooser1.setFileFilter(new LSTFileFilter());
            jFileChooser1.setName("jFileChooser1"); // NOI18N

            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            setTitle(resourceMap.getString("Form.title")); // NOI18N
            setBackground(resourceMap.getColor("Form.background")); // NOI18N
            setName("Form"); // NOI18N

            jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel1.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, resourceMap.getFont("jPanel1.border.titleFont"))); // NOI18N
            jPanel1.setName("jPanel1"); // NOI18N

            jScrollPane1.setName("jScrollPane1"); // NOI18N

            sourceCodeTable.setModel(new javax.swing.table.DefaultTableModel(
                new Object [][] {
                    {null, "", "Bitte LST-Datei laden..."}
                },
                new String [] {
                    "Breakpoints", "Line", "Code"
                }
            ) {
                Class[] types = new Class [] {
                    java.lang.Boolean.class, java.lang.String.class, java.lang.String.class
                };
                boolean[] canEdit = new boolean [] {
                    false, false, false
                };

                public Class getColumnClass(int columnIndex) {
                    return types [columnIndex];
                }

                public boolean isCellEditable(int rowIndex, int columnIndex) {
                    return canEdit [columnIndex];
                }
            });
            sourceCodeTable.setName("sourceCodeTable"); // NOI18N
            sourceCodeTable.getTableHeader().setReorderingAllowed(false);
            jScrollPane1.setViewportView(sourceCodeTable);
            sourceCodeTable.getColumnModel().getColumn(0).setPreferredWidth(50);
            sourceCodeTable.getColumnModel().getColumn(0).setHeaderValue(resourceMap.getString("sourceCodeTable.columnModel.title0")); // NOI18N
            sourceCodeTable.getColumnModel().getColumn(1).setPreferredWidth(50);
            sourceCodeTable.getColumnModel().getColumn(1).setHeaderValue(resourceMap.getString("sourceCodeTable.columnModel.title1")); // NOI18N
            sourceCodeTable.getColumnModel().getColumn(2).setPreferredWidth(250);
            sourceCodeTable.getColumnModel().getColumn(2).setHeaderValue(resourceMap.getString("sourceCodeTable.columnModel.title2")); // NOI18N

            javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
            jPanel1.setLayout(jPanel1Layout);
            jPanel1Layout.setHorizontalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 455, Short.MAX_VALUE)
            );
            jPanel1Layout.setVerticalGroup(
                jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 574, Short.MAX_VALUE)
            );

            jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel2.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, resourceMap.getFont("jPanel2.border.titleFont"))); // NOI18N
            jPanel2.setName("jPanel2"); // NOI18N

            jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
            jButton1.setName("jButton1"); // NOI18N
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
                }
            });

            jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N
            jButton2.setName("jButton2"); // NOI18N
            jButton2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton2ActionPerformed(evt);
                }
            });

            jButton3.setText(resourceMap.getString("jButton3.text")); // NOI18N
            jButton3.setName("jButton3"); // NOI18N
            jButton3.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton3ActionPerformed(evt);
                }
            });

            jButton4.setText(resourceMap.getString("jButton4.text")); // NOI18N
            jButton4.setName("jButton4"); // NOI18N
            jButton4.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton4ActionPerformed(evt);
                }
            });

            jButton5.setText(resourceMap.getString("jButton5.text")); // NOI18N
            jButton5.setName("jButton5"); // NOI18N
            jButton5.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton5ActionPerformed(evt);
                }
            });

            txtHardware.setText(resourceMap.getString("txtHardware.text")); // NOI18N
            txtHardware.setName("txtHardware"); // NOI18N

            jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "COM1", "COM2", "COM3", "COM4" }));
            jComboBox1.setName("jComboBox1"); // NOI18N

            javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
            jPanel2.setLayout(jPanel2Layout);
            jPanel2Layout.setHorizontalGroup(
                jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 62, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, 62, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jButton3, javax.swing.GroupLayout.DEFAULT_SIZE, 60, Short.MAX_VALUE)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addComponent(jButton4, javax.swing.GroupLayout.DEFAULT_SIZE, 62, Short.MAX_VALUE)
                    .addGap(18, 18, 18)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(txtHardware)
                        .addGroup(jPanel2Layout.createSequentialGroup()
                            .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jButton5)))
                    .addContainerGap())
            );
            jPanel2Layout.setVerticalGroup(
                jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
                    .addComponent(txtHardware)
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton1)
                        .addComponent(jButton2)
                        .addComponent(jButton3)
                        .addComponent(jButton4)
                        .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jButton5))
                    .addGap(20, 20, 20))
            );

            jPanel2Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jButton1, jButton2, jButton3, jButton4});

            jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel3.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, resourceMap.getFont("jPanel3.border.titleFont"))); // NOI18N
            jPanel3.setName("jPanel3"); // NOI18N

            jScrollPane2.setName("jScrollPane2"); // NOI18N

            RegTableBank0.setModel(new javax.swing.table.DefaultTableModel(
                new Object [][] {
                    {"00h", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                    {"10h", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                    {"20h", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                    {"30h", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null}
                },
                new String [] {
                    "Bank 0", "+0", "+1", "+2", "+3", "+4", "+5", "+6", "+7", "+8", "+9", "+A", "+B", "+C", "+D", "+E", "+F"
                }
            ) {
                Class[] types = new Class [] {
                    java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class
                };
                boolean[] canEdit = new boolean [] {
                    false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false
                };

                public Class getColumnClass(int columnIndex) {
                    return types [columnIndex];
                }

                public boolean isCellEditable(int rowIndex, int columnIndex) {
                    return canEdit [columnIndex];
                }
            });
            RegTableBank0.setName("RegTableBank0"); // NOI18N
            RegTableBank0.getTableHeader().setReorderingAllowed(false);
            jScrollPane2.setViewportView(RegTableBank0);
            RegTableBank0.getColumnModel().getColumn(0).setResizable(false);
            RegTableBank0.getColumnModel().getColumn(0).setPreferredWidth(200);
            RegTableBank0.getColumnModel().getColumn(1).setResizable(false);
            RegTableBank0.getColumnModel().getColumn(1).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title1")); // NOI18N
            RegTableBank0.getColumnModel().getColumn(2).setResizable(false);
            RegTableBank0.getColumnModel().getColumn(2).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title2")); // NOI18N
            RegTableBank0.getColumnModel().getColumn(3).setResizable(false);
            RegTableBank0.getColumnModel().getColumn(3).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title3")); // NOI18N
            RegTableBank0.getColumnModel().getColumn(4).setResizable(false);
            RegTableBank0.getColumnModel().getColumn(4).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title4")); // NOI18N
            RegTableBank0.getColumnModel().getColumn(5).setResizable(false);
            RegTableBank0.getColumnModel().getColumn(5).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title5")); // NOI18N
            RegTableBank0.getColumnModel().getColumn(6).setResizable(false);
            RegTableBank0.getColumnModel().getColumn(6).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title6")); // NOI18N
            RegTableBank0.getColumnModel().getColumn(7).setResizable(false);
            RegTableBank0.getColumnModel().getColumn(7).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title7")); // NOI18N
            RegTableBank0.getColumnModel().getColumn(8).setResizable(false);
            RegTableBank0.getColumnModel().getColumn(8).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title8")); // NOI18N
            RegTableBank0.getColumnModel().getColumn(9).setResizable(false);
            RegTableBank0.getColumnModel().getColumn(9).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title9")); // NOI18N
            RegTableBank0.getColumnModel().getColumn(10).setResizable(false);
            RegTableBank0.getColumnModel().getColumn(10).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title10")); // NOI18N
            RegTableBank0.getColumnModel().getColumn(11).setResizable(false);
            RegTableBank0.getColumnModel().getColumn(11).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title11")); // NOI18N
            RegTableBank0.getColumnModel().getColumn(12).setResizable(false);
            RegTableBank0.getColumnModel().getColumn(12).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title12")); // NOI18N
            RegTableBank0.getColumnModel().getColumn(13).setResizable(false);
            RegTableBank0.getColumnModel().getColumn(13).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title13")); // NOI18N
            RegTableBank0.getColumnModel().getColumn(14).setResizable(false);
            RegTableBank0.getColumnModel().getColumn(14).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title14")); // NOI18N
            RegTableBank0.getColumnModel().getColumn(15).setResizable(false);
            RegTableBank0.getColumnModel().getColumn(15).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title15")); // NOI18N
            RegTableBank0.getColumnModel().getColumn(16).setResizable(false);
            RegTableBank0.getColumnModel().getColumn(16).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title16")); // NOI18N

            jScrollPane3.setName("jScrollPane3"); // NOI18N

            RegTableBank1.setModel(new javax.swing.table.DefaultTableModel(
                new Object [][] {
                    {"00h", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                    {"10h", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                    {"20h", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null},
                    {"30h", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null}
                },
                new String [] {
                    "Bank 1", "+0", "+1", "+2", "+3", "+4", "+5", "+6", "+7", "+8", "+9", "+A", "+B", "+C", "+D", "+E", "+F"
                }
            ) {
                Class[] types = new Class [] {
                    java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.String.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class, java.lang.Object.class
                };
                boolean[] canEdit = new boolean [] {
                    false, false, false, false, false, false, false, false, false, false, false, false, false, false, false, true, false
                };

                public Class getColumnClass(int columnIndex) {
                    return types [columnIndex];
                }

                public boolean isCellEditable(int rowIndex, int columnIndex) {
                    return canEdit [columnIndex];
                }
            });
            RegTableBank1.setName("RegTableBank1"); // NOI18N
            RegTableBank1.getTableHeader().setReorderingAllowed(false);
            jScrollPane3.setViewportView(RegTableBank1);
            RegTableBank1.getColumnModel().getColumn(0).setResizable(false);
            RegTableBank1.getColumnModel().getColumn(0).setPreferredWidth(200);
            RegTableBank1.getColumnModel().getColumn(0).setHeaderValue(resourceMap.getString("RegTableBank1.columnModel.title0")); // NOI18N
            RegTableBank1.getColumnModel().getColumn(1).setResizable(false);
            RegTableBank1.getColumnModel().getColumn(1).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title1")); // NOI18N
            RegTableBank1.getColumnModel().getColumn(2).setResizable(false);
            RegTableBank1.getColumnModel().getColumn(2).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title2")); // NOI18N
            RegTableBank1.getColumnModel().getColumn(3).setResizable(false);
            RegTableBank1.getColumnModel().getColumn(3).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title3")); // NOI18N
            RegTableBank1.getColumnModel().getColumn(4).setResizable(false);
            RegTableBank1.getColumnModel().getColumn(4).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title4")); // NOI18N
            RegTableBank1.getColumnModel().getColumn(5).setResizable(false);
            RegTableBank1.getColumnModel().getColumn(5).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title5")); // NOI18N
            RegTableBank1.getColumnModel().getColumn(6).setResizable(false);
            RegTableBank1.getColumnModel().getColumn(6).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title6")); // NOI18N
            RegTableBank1.getColumnModel().getColumn(7).setResizable(false);
            RegTableBank1.getColumnModel().getColumn(7).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title7")); // NOI18N
            RegTableBank1.getColumnModel().getColumn(8).setResizable(false);
            RegTableBank1.getColumnModel().getColumn(8).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title8")); // NOI18N
            RegTableBank1.getColumnModel().getColumn(9).setResizable(false);
            RegTableBank1.getColumnModel().getColumn(9).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title9")); // NOI18N
            RegTableBank1.getColumnModel().getColumn(10).setResizable(false);
            RegTableBank1.getColumnModel().getColumn(10).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title10")); // NOI18N
            RegTableBank1.getColumnModel().getColumn(11).setResizable(false);
            RegTableBank1.getColumnModel().getColumn(11).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title11")); // NOI18N
            RegTableBank1.getColumnModel().getColumn(12).setResizable(false);
            RegTableBank1.getColumnModel().getColumn(12).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title12")); // NOI18N
            RegTableBank1.getColumnModel().getColumn(13).setResizable(false);
            RegTableBank1.getColumnModel().getColumn(13).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title13")); // NOI18N
            RegTableBank1.getColumnModel().getColumn(14).setResizable(false);
            RegTableBank1.getColumnModel().getColumn(14).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title14")); // NOI18N
            RegTableBank1.getColumnModel().getColumn(15).setResizable(false);
            RegTableBank1.getColumnModel().getColumn(15).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title15")); // NOI18N
            RegTableBank1.getColumnModel().getColumn(16).setResizable(false);
            RegTableBank1.getColumnModel().getColumn(16).setHeaderValue(resourceMap.getString("RegTableBank0.columnModel.title16")); // NOI18N

            jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
            jLabel1.setName("jLabel1"); // NOI18N

            jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
            jLabel2.setName("jLabel2"); // NOI18N

            jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
            jLabel3.setName("jLabel3"); // NOI18N

            jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
            jLabel4.setName("jLabel4"); // NOI18N

            jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
            jLabel5.setName("jLabel5"); // NOI18N

            jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
            jLabel6.setName("jLabel6"); // NOI18N

            jScrollPane4.setName("jScrollPane4"); // NOI18N

            stackTable.setModel(new javax.swing.table.DefaultTableModel(
                new Object [][] {
                    {null},
                    {null},
                    {null},
                    {null},
                    {null},
                    {null},
                    {null},
                    {null}
                },
                new String [] {
                    "Stack"
                }
            ) {
                Class[] types = new Class [] {
                    java.lang.Integer.class
                };
                boolean[] canEdit = new boolean [] {
                    false
                };

                public Class getColumnClass(int columnIndex) {
                    return types [columnIndex];
                }

                public boolean isCellEditable(int rowIndex, int columnIndex) {
                    return canEdit [columnIndex];
                }
            });
            stackTable.setName("stackTable"); // NOI18N
            jScrollPane4.setViewportView(stackTable);
            stackTable.getColumnModel().getColumn(0).setResizable(false);
            stackTable.getColumnModel().getColumn(0).setHeaderValue(resourceMap.getString("stackTable.columnModel.title0")); // NOI18N

            txtPC.setText(resourceMap.getString("txtPC.text")); // NOI18N
            txtPC.setName("txtPC"); // NOI18N

            txtW.setText(resourceMap.getString("txtW.text")); // NOI18N
            txtW.setName("txtW"); // NOI18N

            txtStatus.setText(resourceMap.getString("txtStatus.text")); // NOI18N
            txtStatus.setName("txtStatus"); // NOI18N

            txtFSR.setText(resourceMap.getString("txtFSR.text")); // NOI18N
            txtFSR.setName("txtFSR"); // NOI18N

            txtOpt.setText(resourceMap.getString("txtOpt.text")); // NOI18N
            txtOpt.setName("txtOpt"); // NOI18N

            txtTime.setText(resourceMap.getString("txtTime.text")); // NOI18N
            txtTime.setName("txtTime"); // NOI18N

            jLabelPrescaler.setText(resourceMap.getString("jLabelPrescaler.text")); // NOI18N
            jLabelPrescaler.setName("jLabelPrescaler"); // NOI18N

            jLabelcurrentPrescalerRatio.setText(resourceMap.getString("jLabelcurrentPrescalerRatio.text")); // NOI18N
            jLabelcurrentPrescalerRatio.setName("jLabelcurrentPrescalerRatio"); // NOI18N

            txtPrescaler.setText(resourceMap.getString("txtPrescaler.text")); // NOI18N
            txtPrescaler.setName("txtPrescaler"); // NOI18N

            txtRatio.setText(resourceMap.getString("txtRatio.text")); // NOI18N
            txtRatio.setName("txtRatio"); // NOI18N

            jLabel11.setFont(resourceMap.getFont("jLabel11.font")); // NOI18N
            jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
            jLabel11.setName("jLabel11"); // NOI18N

            javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
            jPanel3.setLayout(jPanel3Layout);
            jPanel3Layout.setHorizontalGroup(
                jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel3Layout.createSequentialGroup()
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel1)
                                .addComponent(jLabel3)
                                .addComponent(jLabel4)
                                .addComponent(jLabel5)
                                .addComponent(jLabel2))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addComponent(txtW, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(txtStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(txtFSR, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(txtOpt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(txtPC, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGroup(jPanel3Layout.createSequentialGroup()
                            .addComponent(jLabel6)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 19, Short.MAX_VALUE)
                            .addComponent(txtTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGap(64, 64, 64)
                    .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel3Layout.createSequentialGroup()
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabelPrescaler)
                                .addComponent(jLabelcurrentPrescalerRatio))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(txtPrescaler)
                                .addComponent(txtRatio, javax.swing.GroupLayout.DEFAULT_SIZE, 55, Short.MAX_VALUE)))
                        .addComponent(jLabel11))
                    .addGap(82, 82, 82))
                .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 468, Short.MAX_VALUE)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 468, Short.MAX_VALUE)
            );

            jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {txtFSR, txtOpt, txtPC, txtStatus, txtTime, txtW});

            jPanel3Layout.setVerticalGroup(
                jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel3Layout.createSequentialGroup()
                    .addContainerGap()
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel3Layout.createSequentialGroup()
                            .addGap(34, 34, 34)
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(jPanel3Layout.createSequentialGroup()
                                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel1)
                                        .addComponent(txtPC, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel6)
                                        .addComponent(txtTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(txtW, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(jLabel2))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel3)
                                        .addComponent(txtStatus, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel4)
                                        .addComponent(txtFSR, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                        .addComponent(jLabel5)
                                        .addComponent(txtOpt, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addComponent(jScrollPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 156, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGroup(jPanel3Layout.createSequentialGroup()
                            .addGap(32, 32, 32)
                            .addComponent(jLabel11)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabelPrescaler)
                                .addComponent(txtPrescaler, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabelcurrentPrescalerRatio)
                                .addComponent(txtRatio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            );

            jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, resourceMap.getString("jPanel4.border.title"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, resourceMap.getFont("jPanel4.border.titleFont"))); // NOI18N
            jPanel4.setFont(resourceMap.getFont("jPanel4.font")); // NOI18N
            jPanel4.setName("jPanel4"); // NOI18N

            jLabel7.setFont(resourceMap.getFont("jLabel7.font")); // NOI18N
            jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
            jLabel7.setName("jLabel7"); // NOI18N

            jLabel8.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
            jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
            jLabel8.setName("jLabel8"); // NOI18N

            boxA0.setText(resourceMap.getString("boxA0.text")); // NOI18N
            boxA0.setName("boxA0"); // NOI18N

            boxA1.setText(resourceMap.getString("boxA1.text")); // NOI18N
            boxA1.setName("boxA1"); // NOI18N

            boxA2.setText(resourceMap.getString("boxA2.text")); // NOI18N
            boxA2.setName("boxA2"); // NOI18N

            boxA3.setText(resourceMap.getString("boxA3.text")); // NOI18N
            boxA3.setName("boxA3"); // NOI18N

            boxA4.setText(resourceMap.getString("boxA4.text")); // NOI18N
            boxA4.setName("boxA4"); // NOI18N

            boxB3.setText(resourceMap.getString("boxB3.text")); // NOI18N
            boxB3.setName("boxB3"); // NOI18N

            boxB4.setText(resourceMap.getString("boxB4.text")); // NOI18N
            boxB4.setName("boxB4"); // NOI18N

            boxB1.setText(resourceMap.getString("boxB1.text")); // NOI18N
            boxB1.setName("boxB1"); // NOI18N

            boxB2.setText(resourceMap.getString("boxB2.text")); // NOI18N
            boxB2.setName("boxB2"); // NOI18N

            boxB0.setText(resourceMap.getString("boxB0.text")); // NOI18N
            boxB0.setName("boxB0"); // NOI18N

            boxB6.setText(resourceMap.getString("boxB6.text")); // NOI18N
            boxB6.setActionCommand(resourceMap.getString("boxB6.actionCommand")); // NOI18N
            boxB6.setName("boxB6"); // NOI18N

            boxB7.setText(resourceMap.getString("boxB7.text")); // NOI18N
            boxB7.setName("boxB7"); // NOI18N

            boxB5.setText(resourceMap.getString("boxB5.text")); // NOI18N
            boxB5.setActionCommand(resourceMap.getString("boxB5.actionCommand")); // NOI18N
            boxB5.setName("boxB5"); // NOI18N

            jLabel9.setFont(resourceMap.getFont("jLabel9.font")); // NOI18N
            jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
            jLabel9.setName("jLabel9"); // NOI18N

            boxLatchA0.setText(resourceMap.getString("boxLatchA0.text")); // NOI18N
            boxLatchA0.setEnabled(false);
            boxLatchA0.setName("boxLatchA0"); // NOI18N

            boxLatchA1.setText(resourceMap.getString("boxLatchA1.text")); // NOI18N
            boxLatchA1.setEnabled(false);
            boxLatchA1.setName("boxLatchA1"); // NOI18N

            boxLatchA2.setText(resourceMap.getString("boxLatchA2.text")); // NOI18N
            boxLatchA2.setEnabled(false);
            boxLatchA2.setName("boxLatchA2"); // NOI18N

            boxLatchA3.setText(resourceMap.getString("boxLatchA3.text")); // NOI18N
            boxLatchA3.setEnabled(false);
            boxLatchA3.setName("boxLatchA3"); // NOI18N

            boxLatchA4.setText(resourceMap.getString("boxLatchA4.text")); // NOI18N
            boxLatchA4.setEnabled(false);
            boxLatchA4.setName("boxLatchA4"); // NOI18N

            boxLatchB5.setText(resourceMap.getString("boxLatchB5.text")); // NOI18N
            boxLatchB5.setEnabled(false);
            boxLatchB5.setName("boxLatchB5"); // NOI18N

            boxLatchB1.setText(resourceMap.getString("boxLatchB1.text")); // NOI18N
            boxLatchB1.setEnabled(false);
            boxLatchB1.setName("boxLatchB1"); // NOI18N

            boxLatchB3.setText(resourceMap.getString("boxLatchB3.text")); // NOI18N
            boxLatchB3.setEnabled(false);
            boxLatchB3.setName("boxLatchB3"); // NOI18N

            boxLatchB4.setText(resourceMap.getString("boxLatchB4.text")); // NOI18N
            boxLatchB4.setEnabled(false);
            boxLatchB4.setName("boxLatchB4"); // NOI18N

            boxLatchB7.setText(resourceMap.getString("boxLatchB7.text")); // NOI18N
            boxLatchB7.setEnabled(false);
            boxLatchB7.setName("boxLatchB7"); // NOI18N

            boxLatchB6.setText(resourceMap.getString("boxLatchB6.text")); // NOI18N
            boxLatchB6.setEnabled(false);
            boxLatchB6.setName("boxLatchB6"); // NOI18N

            boxLatchB0.setText(resourceMap.getString("boxLatchB0.text")); // NOI18N
            boxLatchB0.setEnabled(false);
            boxLatchB0.setName("boxLatchB0"); // NOI18N

            boxLatchB2.setText(resourceMap.getString("boxLatchB2.text")); // NOI18N
            boxLatchB2.setEnabled(false);
            boxLatchB2.setName("boxLatchB2"); // NOI18N

            jLabel10.setFont(resourceMap.getFont("jLabel10.font")); // NOI18N
            jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
            jLabel10.setName("jLabel10"); // NOI18N

            buttTaktEin.setText(resourceMap.getString("buttTaktEin.text")); // NOI18N
            buttTaktEin.setName("buttTaktEin"); // NOI18N
            buttTaktEin.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    buttTaktEinActionPerformed(evt);
                }
            });

            jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
            jLabel12.setName("jLabel12"); // NOI18N

            javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
            jPanel4.setLayout(jPanel4Layout);
            jPanel4Layout.setHorizontalGroup(
                jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel4Layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel7)
                        .addComponent(boxA4)
                        .addComponent(boxA3)
                        .addComponent(boxA2)
                        .addComponent(boxA1)
                        .addComponent(boxA0)
                        .addComponent(jLabel12))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel9)
                        .addComponent(boxLatchA3)
                        .addComponent(boxLatchA0)
                        .addComponent(boxLatchA1)
                        .addComponent(boxLatchA2)
                        .addComponent(boxLatchA4)
                        .addComponent(buttTaktEin))
                    .addGap(76, 76, 76)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel8)
                        .addComponent(boxB7)
                        .addComponent(boxB6)
                        .addComponent(boxB5)
                        .addComponent(boxB4)
                        .addComponent(boxB3)
                        .addComponent(boxB2)
                        .addComponent(boxB1)
                        .addComponent(boxB0))
                    .addGap(18, 18, 18)
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabel10)
                        .addComponent(boxLatchB7)
                        .addComponent(boxLatchB6)
                        .addComponent(boxLatchB5)
                        .addComponent(boxLatchB4)
                        .addComponent(boxLatchB3)
                        .addComponent(boxLatchB2)
                        .addComponent(boxLatchB1)
                        .addComponent(boxLatchB0))
                    .addContainerGap(126, Short.MAX_VALUE))
            );
            jPanel4Layout.setVerticalGroup(
                jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel4Layout.createSequentialGroup()
                    .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(jPanel4Layout.createSequentialGroup()
                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel7)
                                .addComponent(jLabel9))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                .addGroup(jPanel4Layout.createSequentialGroup()
                                    .addComponent(boxA0)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxA1)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxA2)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxA3)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxA4))
                                .addGroup(jPanel4Layout.createSequentialGroup()
                                    .addComponent(boxLatchA0)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxLatchA1)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxLatchA2)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxLatchA3)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxLatchA4)))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel12)
                                .addComponent(buttTaktEin)))
                        .addGroup(jPanel4Layout.createSequentialGroup()
                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel8)
                                .addComponent(jLabel10))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addGroup(jPanel4Layout.createSequentialGroup()
                                    .addComponent(boxB0)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxB1)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxB2)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxB3)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxB4)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxB5)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxB6)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxB7))
                                .addGroup(jPanel4Layout.createSequentialGroup()
                                    .addComponent(boxLatchB0)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxLatchB1)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxLatchB2)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxLatchB3)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxLatchB4)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxLatchB5)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxLatchB6)
                                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(boxLatchB7)))))
                    .addContainerGap(20, Short.MAX_VALUE))
            );

            jMenuBar1.setName("jMenuBar1"); // NOI18N

            jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
            jMenu1.setName("jMenu1"); // NOI18N

            jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_D, java.awt.event.InputEvent.CTRL_MASK));
            jMenuItem1.setText(resourceMap.getString("jMenuItem1.text")); // NOI18N
            jMenuItem1.setName("jMenuItem1"); // NOI18N
            jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jMenuItem1ActionPerformed(evt);
                }
            });
            jMenu1.add(jMenuItem1);

            jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Q, java.awt.event.InputEvent.CTRL_MASK));
            jMenuItem2.setText(resourceMap.getString("jMenuItem2.text")); // NOI18N
            jMenuItem2.setName("jMenuItem2"); // NOI18N
            jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jMenuItem2ActionPerformed(evt);
                }
            });
            jMenu1.add(jMenuItem2);

            jMenuBar1.add(jMenu1);

            jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
            jMenu2.setName("jMenu2"); // NOI18N

            jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0));
            jMenuItem3.setText(resourceMap.getString("jMenuItem3.text")); // NOI18N
            jMenuItem3.setName("jMenuItem3"); // NOI18N
            jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jMenuItem3ActionPerformed(evt);
                }
            });
            jMenu2.add(jMenuItem3);

            jMenuBar1.add(jMenu2);

            setJMenuBar(jMenuBar1);

            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addContainerGap()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jPanel1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addContainerGap())
            );
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addContainerGap())
            );

            pack();
        }// </editor-fold>//GEN-END:initComponents

    /**
     * Handler für Datei-öffnen-MenuItem. Öffnet einen FileChooser.
     * @param evt
     */
    private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem1ActionPerformed
        try {
            // this ist der Frame aus dem heraus der FileChooser aufgerufen wird
            int option = jFileChooser1.showOpenDialog(this);

            // Nutzer hat Öffnen geklickt
            if (option == JFileChooser.APPROVE_OPTION) {
                //Datei-Pfad an Pic übergeben.
                File dir = jFileChooser1.getSelectedFile();
                Pic.getInstance().setDir(dir);
                //Reset durchführen
                Pic.getInstance().reset();
                //Startmethode anhalten
                Pic.getInstance().setStop(true);
                Pic.getInstance().fillTable();
            } else if (option == JFileChooser.CANCEL_OPTION) {
                // Nutzer hat Abbrechen gewählt
            } else if (option == JFileChooser.ERROR_OPTION) {
                //Irgendeine Art von Fehler ist aufgetreten
            }
        } catch (NullPointerException e) {
            e.printStackTrace();
        }

    }//GEN-LAST:event_jMenuItem1ActionPerformed
    /**
     * Handler für Beenden-MenuItem. Beendet das Programm
     * @param evt
     */
    private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
        System.exit(0);
    }//GEN-LAST:event_jMenuItem2ActionPerformed
    /**
     * Handler für Start-Button. Erstellt einen neuen Thread,
     * der den Programmablauf steuert.
     * @param evt
     */
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        //Thread starten
        thread = new StartThread();
        thread.start();

    }//GEN-LAST:event_jButton1ActionPerformed
    /**
     * Handler für Step-Button. Führt einen Programmschritt aus.
     * @param evt
     */
    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        Pic.getInstance().step();
    }//GEN-LAST:event_jButton3ActionPerformed
    /**
     * Handler für Reset-Button. Setzt die Werte aus der {@link Pic}-Instanz zurück
     * und hält den den Thread aus {@link jButton1ActionPerformed} an.
     * @param evt
     */
    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
        //Reset durchführen
        Pic.getInstance().reset();
        //Startmethode anhalten
        Pic.getInstance().setStop(true);
    }//GEN-LAST:event_jButton4ActionPerformed
    /**
     * Hält den den Thread aus {@link jButton1ActionPerformed} an.
     * @param evt
     */
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        Pic.getInstance().setStop(true);
    }//GEN-LAST:event_jButton2ActionPerformed
    /**
     * Handler für Hilfe-MenuItem. Öffnet externes PDF-File.
     * @param evt
     */
    private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
        Process p = null;
        try {
            p = Runtime.getRuntime().exec("rundll32 url.dll,FileProtocolHandler doku.pdf");
        } catch (IOException ex) {
            Logger.getLogger(PICView.class.getName()).log(Level.SEVERE, null, ex);
        }
        try {
            p.waitFor();
        } catch (InterruptedException ex) {
            Logger.getLogger(PICView.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jMenuItem3ActionPerformed
    /**
     * Handler für Takt-ein/aus-Button. Startet oder beendet Thread für den Taktgeber.
     * @param evt
     */
    private void buttTaktEinActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttTaktEinActionPerformed
        //Button soll abwechselnd den Takt ein oder ausschalten.
        if (toggle == true) {
            clock = new Clock();
            clock.start();
            toggle = false;
        } else {
            clock.clockStop();
            toggle = true;
        }

    }//GEN-LAST:event_buttTaktEinActionPerformed

    /**
     * Handler für den Com-ein/aus-Button.
     * Wenn keine aktive ComPort-Verbindung besteht: Aktiviert eine ComPort-Verbindung mit ausgewählten ComPort aus der ComboBox und
     * ändert den Text auf dem dazugehörigen Label.
     * Wenn Verbindung besteht: Schließt die aktuelle ComPort-Verbindung und
     * ändert den Text auf dem dazugehörigen Label.
     * @param evt
     */
    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed

        if (Pic.getInstance().getCom() != null) {
            String comPort = (String) jComboBox1.getSelectedItem();
            Pic.getInstance().connectComPort(comPort);
            txtHardware.setText("Hardwarekomm. EIN");
        } else {
            Pic.getInstance().closeComPort();
            txtHardware.setText("Hardwarekomm. AUS");
        }
    }//GEN-LAST:event_jButton5ActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTable RegTableBank0;
    private javax.swing.JTable RegTableBank1;
    private javax.swing.JCheckBox boxA0;
    private javax.swing.JCheckBox boxA1;
    private javax.swing.JCheckBox boxA2;
    private javax.swing.JCheckBox boxA3;
    private javax.swing.JCheckBox boxA4;
    private javax.swing.JCheckBox boxB0;
    private javax.swing.JCheckBox boxB1;
    private javax.swing.JCheckBox boxB2;
    private javax.swing.JCheckBox boxB3;
    private javax.swing.JCheckBox boxB4;
    private javax.swing.JCheckBox boxB5;
    private javax.swing.JCheckBox boxB6;
    private javax.swing.JCheckBox boxB7;
    private javax.swing.JCheckBox boxLatchA0;
    private javax.swing.JCheckBox boxLatchA1;
    private javax.swing.JCheckBox boxLatchA2;
    private javax.swing.JCheckBox boxLatchA3;
    private javax.swing.JCheckBox boxLatchA4;
    private javax.swing.JCheckBox boxLatchB0;
    private javax.swing.JCheckBox boxLatchB1;
    private javax.swing.JCheckBox boxLatchB2;
    private javax.swing.JCheckBox boxLatchB3;
    private javax.swing.JCheckBox boxLatchB4;
    private javax.swing.JCheckBox boxLatchB5;
    private javax.swing.JCheckBox boxLatchB6;
    private javax.swing.JCheckBox boxLatchB7;
    private javax.swing.JButton buttTaktEin;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JFileChooser jFileChooser1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabelPrescaler;
    private javax.swing.JLabel jLabelcurrentPrescalerRatio;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JTable sourceCodeTable;
    private javax.swing.JTable stackTable;
    private javax.swing.JTextField txtFSR;
    private javax.swing.JLabel txtHardware;
    private javax.swing.JTextField txtOpt;
    private javax.swing.JTextField txtPC;
    private javax.swing.JTextField txtPrescaler;
    private javax.swing.JTextField txtRatio;
    private javax.swing.JTextField txtStatus;
    private javax.swing.JTextField txtTime;
    private javax.swing.JTextField txtW;
    // End of variables declaration//GEN-END:variables

    /**
     * @return the RegTableBank0
     */
    public javax.swing.JTable getRegTableBank0() {
        return RegTableBank0;
    }

    /**
     * @return the RegTableBank1
     */
    public javax.swing.JTable getRegTableBank1() {
        return RegTableBank1;
    }

    /**
     * @return the sourceCodeTable
     */
    public javax.swing.JTable getSourceCodeTable() {
        return sourceCodeTable;
    }

    /**
     * @return the txtFSR
     */
    public javax.swing.JTextField getTxtFSR() {
        return txtFSR;
    }

    /**
     * @return the txtOpt
     */
    public javax.swing.JTextField getTxtOpt() {
        return txtOpt;
    }

    /**
     * @return the txtPC
     */
    public javax.swing.JTextField getTxtPC() {
        return txtPC;
    }

    /**
     * @return the txtStatus
     */
    public javax.swing.JTextField getTxtStatus() {
        return txtStatus;
    }

    /**
     * @return the txtTime
     */
    public javax.swing.JTextField getTxtTime() {
        return txtTime;
    }

    /**
     * @return the txtW
     */
    public javax.swing.JTextField getTxtW() {
        return txtW;
    }

    /**
     * @return the stackTable
     */
    public javax.swing.JTable getStackTable() {
        return stackTable;
    }

    /**
     * @return the boxA0
     */
    public javax.swing.JCheckBox getBoxA0() {
        return boxA0;
    }

    /**
     * @return the boxA1
     */
    public javax.swing.JCheckBox getBoxA1() {
        return boxA1;
    }

    /**
     * @return the boxA2
     */
    public javax.swing.JCheckBox getBoxA2() {
        return boxA2;
    }

    /**
     * @return the boxA3
     */
    public javax.swing.JCheckBox getBoxA3() {
        return boxA3;
    }

    /**
     * @return the boxA4
     */
    public javax.swing.JCheckBox getBoxA4() {
        return boxA4;
    }

    /**
     * @return the boxB0
     */
    public javax.swing.JCheckBox getBoxB0() {
        return boxB0;
    }

    /**
     * @return the boxB1
     */
    public javax.swing.JCheckBox getBoxB1() {
        return boxB1;
    }

    /**
     * @return the boxB2
     */
    public javax.swing.JCheckBox getBoxB2() {
        return boxB2;
    }

    /**
     * @return the boxB3
     */
    public javax.swing.JCheckBox getBoxB3() {
        return boxB3;
    }

    /**
     * @return the boxB4
     */
    public javax.swing.JCheckBox getBoxB4() {
        return boxB4;
    }

    /**
     * @return the boxB5
     */
    public javax.swing.JCheckBox getBoxB5() {
        return boxB5;
    }

    /**
     * @return the boxB6
     */
    public javax.swing.JCheckBox getBoxB6() {
        return boxB6;
    }

    /**
     * @return the boxB7
     */
    public javax.swing.JCheckBox getBoxB7() {
        return boxB7;
    }

    /**
     * Helfer, um die Breakpoints in der Spalte 0 auszulesen und in
     * einem Array abzulegen. True = Breakpoint gesetzt
     * @return Array, das die gesetzen Breakpoints enthält.
     */
    public boolean[] getBreakpoints() {
        boolean[] breakpoints = new boolean[sourceCodeTable.getRowCount()];

        for (int i = 0; i < breakpoints.length; i++) {
            Object value = sourceCodeTable.getValueAt(i, 0);
            if (value == null) {
                value = false;
            }

            breakpoints[i] = (Boolean) value;
        }

        return breakpoints;
    }

    /**
     * Stoppt den aktuellen Thread.
     */
    public void stop() {
        thread = null;
    }

    /**
     * @return the boxLatchA0
     */
    public javax.swing.JCheckBox getBoxLatchA0() {
        return boxLatchA0;
    }

    /**
     * @return the boxLatchA1
     */
    public javax.swing.JCheckBox getBoxLatchA1() {
        return boxLatchA1;
    }

    /**
     * @return the boxLatchA3
     */
    public javax.swing.JCheckBox getBoxLatchA2() {
        return boxLatchA2;
    }

    /**
     * @return the boxLatchA4
     */
    public javax.swing.JCheckBox getBoxLatchA3() {
        return boxLatchA3;
    }

    /**
     * @return the boxLatchA5
     */
    public javax.swing.JCheckBox getBoxLatchA4() {
        return boxLatchA4;
    }

    /**
     * @return the boxLatchB0
     */
    public javax.swing.JCheckBox getBoxLatchB0() {
        return boxLatchB0;
    }

    /**
     * @return the boxLatchB1
     */
    public javax.swing.JCheckBox getBoxLatchB1() {
        return boxLatchB1;
    }

    /**
     * @return the boxLatchB2
     */
    public javax.swing.JCheckBox getBoxLatchB2() {
        return boxLatchB2;
    }

    /**
     * @return the boxLatchB3
     */
    public javax.swing.JCheckBox getBoxLatchB3() {
        return boxLatchB3;
    }

    /**
     * @return the boxLatchB4
     */
    public javax.swing.JCheckBox getBoxLatchB4() {
        return boxLatchB4;
    }

    /**
     * @return the boxLatchB5
     */
    public javax.swing.JCheckBox getBoxLatchB5() {
        return boxLatchB5;
    }

    /**
     * @return the boxLatchB6
     */
    public javax.swing.JCheckBox getBoxLatchB6() {
        return boxLatchB6;
    }

    /**
     * @return the boxLatchB7
     */
    public javax.swing.JCheckBox getBoxLatchB7() {
        return boxLatchB7;
    }

    /**
     * @return the txtPrescaler
     */
    public javax.swing.JTextField getTxtPrescaler() {
        return txtPrescaler;
    }

    /**
     * @return the txtRatio
     */
    public javax.swing.JTextField getTxtRatio() {
        return txtRatio;
    }
}
